Skip to content

refactor(FR-2847): split admin deployment detail route under /admin-deployments/:id#7312

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-08-refactor_fr-2847_split_admin_deployment_detail_route
May 8, 2026
Merged

refactor(FR-2847): split admin deployment detail route under /admin-deployments/:id#7312
graphite-app[bot] merged 1 commit into
mainfrom
05-08-refactor_fr-2847_split_admin_deployment_detail_route

Conversation

@yomybaby
Copy link
Copy Markdown
Member

@yomybaby yomybaby commented May 8, 2026

Resolves #7310(FR-2847)

Summary

Split the admin-side deployment detail page from the user-side one at the route level. Admins now stay under /admin-deployments/* when navigating into a deployment detail, preserving the admin context through breadcrumbs and back navigation. The detail page component (DeploymentDetailPage) is unchanged — only the route is separated.

Changes

  • react/src/routes.tsx
    • Add new child route /admin-deployments/:deploymentId that mounts the same DeploymentDetailPage inside the existing /admin-deployments parent route, using the same BAIErrorBoundary + Suspense pattern as sibling children.
    • Add handle: { labelKey: 'webui.menu.DeploymentDetail' } so the breadcrumb resolves correctly under the admin route.
    • Update the legacy /admin-serving/:serviceId redirect to point to /admin-deployments/:serviceId (was /deployments/:serviceId), so old admin links keep landing inside the admin URL space.
    • Update the stale comment that said "/admin-deployments has no nested detail route".
  • react/src/pages/AdminDeploymentListPage.tsx — row click now navigates to /admin-deployments/${id} instead of /deployments/${id}.
  • react/src/components/EndpointList.tsx — when rendered with isAdminMode, the BAINameActionCell to prop now points at /admin-deployments/${endpoint_id} instead of /deployments/${endpoint_id}. (AdminServingPage does not navigate to detail directly — it composes EndpointList with isAdminMode, which is the actual entry point from the legacy admin-serving tab.)

Out of scope

  • DeploymentTagChips.tsx already branches on pathname.startsWith('/admin-deployments') and navigates to the list (not detail) for tag filters — unchanged.
  • DeploymentConfigurationSection.tsx (FR-2846) and delete-icon styling (FR-2848) intentionally untouched.

Verification

bash scripts/verify.sh: Relay PASS, Lint PASS, Format PASS. TypeScript shows pre-existing errors in packages/backend.ai-client/src/client.ts and react/src/components/DeleteForeverVFolderModalV2.tsx that are unchanged from main and unrelated to FR-2847 (git diff main HEAD -- confirms).

Copilot AI review requested due to automatic review settings May 8, 2026 06:30
@github-actions github-actions Bot added the size:M 30~100 LoC label May 8, 2026
Copy link
Copy Markdown
Member Author

yomybaby commented May 8, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Coverage Report for react-coverage (./react)

Status Category Percentage Covered / Total
🔵 Lines 6.51% 1783 / 27351
🔵 Statements 5.39% 1978 / 36681
🔵 Functions 5.19% 296 / 5694
🔵 Branches 3.78% 1293 / 34158
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
react/src/routes.tsx 0% 0% 0% 0% 40-1004
react/src/components/EndpointList.tsx 0% 0% 0% 0% 53-308
react/src/pages/AdminDeploymentListPage.tsx 0% 0% 0% 0% 44-64
Generated in workflow #465 for commit 802c916 by the Vitest Coverage Report Action

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the admin deployment detail navigation so admins can view deployment details under the admin-scoped URL space (/admin-deployments/:deploymentId), keeping breadcrumbs/back navigation within the admin context while reusing the existing shared DeploymentDetailPage.

Changes:

  • Added a nested admin deployment detail route at /admin-deployments/:deploymentId that renders DeploymentDetailPage.
  • Updated the legacy /admin-serving/:serviceId redirect to point to /admin-deployments/:serviceId.
  • Updated admin-facing navigation links (admin deployment list row click, admin endpoint list links) to route to /admin-deployments/:id.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
react/src/routes.tsx Adds /admin-deployments/:deploymentId route and retargets legacy /admin-serving/:serviceId redirect to the admin-scoped detail route.
react/src/pages/AdminDeploymentListPage.tsx Updates admin deployment list row navigation to go to /admin-deployments/:deploymentId.
react/src/components/EndpointList.tsx Updates admin-mode endpoint name links to point to /admin-deployments/:id instead of the user-scoped route.

Comment thread react/src/routes.tsx
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 8, 2026

Merge activity

…eployments/:id (#7312)

Resolves #7310(FR-2847)

## Summary

Split the admin-side deployment detail page from the user-side one at the route level. Admins now stay under `/admin-deployments/*` when navigating into a deployment detail, preserving the admin context through breadcrumbs and back navigation. The detail page **component** (`DeploymentDetailPage`) is unchanged — only the route is separated.

## Changes

- **`react/src/routes.tsx`**
  - Add new child route `/admin-deployments/:deploymentId` that mounts the same `DeploymentDetailPage` inside the existing `/admin-deployments` parent route, using the same `BAIErrorBoundary` + `Suspense` pattern as sibling children.
  - Add `handle: { labelKey: 'webui.menu.DeploymentDetail' }` so the breadcrumb resolves correctly under the admin route.
  - Update the legacy `/admin-serving/:serviceId` redirect to point to `/admin-deployments/:serviceId` (was `/deployments/:serviceId`), so old admin links keep landing inside the admin URL space.
  - Update the stale comment that said "/admin-deployments has no nested detail route".
- **`react/src/pages/AdminDeploymentListPage.tsx`** — row click now navigates to `/admin-deployments/${id}` instead of `/deployments/${id}`.
- **`react/src/components/EndpointList.tsx`** — when rendered with `isAdminMode`, the `BAINameActionCell` `to` prop now points at `/admin-deployments/${endpoint_id}` instead of `/deployments/${endpoint_id}`. (`AdminServingPage` does not navigate to detail directly — it composes `EndpointList` with `isAdminMode`, which is the actual entry point from the legacy admin-serving tab.)

## Out of scope

- `DeploymentTagChips.tsx` already branches on `pathname.startsWith('/admin-deployments')` and navigates to the **list** (not detail) for tag filters — unchanged.
- `DeploymentConfigurationSection.tsx` (FR-2846) and delete-icon styling (FR-2848) intentionally untouched.

## Verification

`bash scripts/verify.sh`: Relay PASS, Lint PASS, Format PASS. TypeScript shows pre-existing errors in `packages/backend.ai-client/src/client.ts` and `react/src/components/DeleteForeverVFolderModalV2.tsx` that are unchanged from `main` and unrelated to FR-2847 (`git diff main HEAD --` confirms).
@graphite-app graphite-app Bot force-pushed the 05-08-refactor_fr-2847_split_admin_deployment_detail_route branch from 488cf4b to 802c916 Compare May 8, 2026 07:54
@github-actions github-actions Bot added area:impl Implementation issue. impact:invisible This change is invisible to users (internal changes). platform:web Web-specific issue type:refactor Refactoring current implementation. labels May 8, 2026
@graphite-app graphite-app Bot merged commit 802c916 into main May 8, 2026
12 checks passed
@graphite-app graphite-app Bot deleted the 05-08-refactor_fr-2847_split_admin_deployment_detail_route branch May 8, 2026 07:56
@github-pages github-pages Bot temporarily deployed to github-pages May 8, 2026 07:57 Inactive
graphite-app Bot pushed a commit that referenced this pull request May 8, 2026
…7313)

Resolves #7309(FR-2846)

Stacked on #7312 (FR-2847): the `/admin-deployments/:deploymentId` route this PR's post-delete navigation depends on is added there. Merge bottom-up.

## Summary

On the Deployment detail page, replaces the implicit Delete entry-point with an explicit `...` More dropdown next to the Edit button. Delete is moved into that menu and confirmed via `BAIConfirmModalWithInput` (typed-confirmation), navigating back to the appropriate list (`/admin-deployments` for admin context, `/deployments` otherwise) on success.

## Changes

- `react/src/components/DeploymentConfigurationSection.tsx`
  - Add `Dropdown` (More menu) next to Edit in the Basic Information `BAICard` `extra` slot.
  - Add `DeploymentConfigurationSectionDeleteMutation` (uniquely named to avoid clashing with `DeploymentList.tsx`'s mutation, which is owned by FR-2848).
  - Use `BAIConfirmModalWithInput` with `confirmText = deploymentName` per `.claude/rules/destructive-confirmation.md`.
  - Disable Delete while deployment is in destroying states or while the mutation is in flight.
  - Navigate via `useWebUINavigate` + `useLocation` pathname check (works once stacked on FR-2847).
- `resources/i18n/*.json` (21 files): add `button.More` translation key in every supported locale.

## Test Plan

- [x] More button (`...`) renders to the right of Edit on the Basic Information card.
- [x] Clicking Delete in the More menu opens `BAIConfirmModalWithInput`; OK is disabled until the user types the deployment name.
- [x] On confirm, the mutation runs, success toast shows, and the user is navigated back to the list.
- [x] When opened from `/admin-deployments/:id` (after FR-2847 merges), navigation lands on `/admin-deployments`.
- [x] Failed mutation shows error toast.
- [x] All 21 locales include `button.More`.
- [x] `bash scripts/verify.sh`: Relay PASS, Lint PASS, Format PASS. TypeScript fails only on pre-existing errors in `packages/backend.ai-client/src/client.ts` and `react/src/components/DeleteForeverVFolderModalV2.tsx` — both reproduce on a clean `main` checkout and are unrelated to this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:impl Implementation issue. impact:invisible This change is invisible to users (internal changes). platform:web Web-specific issue size:M 30~100 LoC type:refactor Refactoring current implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Separate admin deployment detail route under /admin-deployments/:deploymentId

2 participants